<?php
/**
 * スターティングメンバー登録画面
 */
require_once APPLICATION_PATH . '/models/HttpRequest/HttpRequestController.php';
require_once APPLICATION_PATH . '/views/Components/Startingmember/Controller.php';
require_once APPLICATION_PATH . '/views/Components/Startingmember/StartingMemberRegist.php';
require_once APPLICATION_PATH . '/views/Components/StartingMember/TestPartialController.php';

/**
 * スターティングメンバー登録
 * @author admin
 *
 */
class StartingmemberController extends Zend_Controller_Action
{
	const CONTROLLER_NAME = 'Startingmember';

	/**
	 * 共通初期化処理
	 */
	public function init()
	{
		$a = 1;
	}

	/**
	 * スターティングメンバー選択画面
	 */
	public function selectAction()
	{
		$objStamen = new Components_StartingMember_Controller('SM', '/Startingmember/regist/');
		$sHtml = $objStamen->fetch();
		if (defined('USE_SMARTY')) {
	 		$this->view->CONTENTS = $sHtml;
	 		$objPartial = new Components_StartingMember_TestPartial_Controller();
	 		$sPartial = $objPartial->fetch();
	 		$this->view->PARTIAL = $sPartial;
		} else {
			$objPartial = new Components_StartingMember_TestPartial_Controller();
			$sPartial = $objPartial->fetch();
			$this->view->assign('PARTIAL',$sPartial);
		}
	}

	/**
	 * スターティングメンバー登録保存画面
	 */
	public function registAction()
	{
		/***
		 * データ保存
		 */
		$objStartingMemberRegist = new Components_StartingMember_Regist();


		/***
		 * 呼び出しもと画面へ復帰
		 */
		$aryRequest = Components_StartingMember_Regist::getPositonRequestForBack(Models_Players_Controller::JUNIOR_SCHOOL);
		$aryRequest[HttpRequest::GAME_ID] = $_REQUEST[HttpRequest::GAME_ID];
		$sQuery = Lib_Request::convRequestToQuery($aryRequest);
		header('Location: /Startingmember/select/?'.$sQuery);
		exit;
	}
}